The approaches described in this section could be pursued, but are not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated herein, the approaches described in this section are not prior art to the claims in this application and are not admitted to be prior art by inclusion in this section.
An application instance communicates with other application instances over a network using application-layer messages. To promote ordered and reliable delivery of application-layer messages, application-layer messages may be embedded in transport-layer messages that are communicated between transport-layer endpoints. The transport-layer endpoints gather the received transport-layer messages and deliver the embedded application-layer messages to the application instances according to the order in which the messages were sent.
Due to packet loss, latency, or for some other reason, segments may be received out-of-order by a transport-layer endpoint. In one example, a transport-layer endpoint sends three segments in order, and the receiving transport-layer endpoint receives the first segment and the third segment, but not the second segment. The second segment may be lost or delayed before reaching the receiving transport-layer endpoint. The third segment in the example is an out-of-order segment because the third segment was third segment was sent after the second segment even though the third segment was received before the second segment. The receiving transport-layer endpoint stores received out-of-order segments in an out-of-order queue.
To ensure ordered and reliable delivery of application-layer messages, application-layer messages from the out-of-order queue are not forwarded to the application instance until the missing segment(s) are received. In the example, once the second segment is received, the application-layer messages in the second and third segments are forwarded to the application. Because the application relies on ordered and reliable delivery of application-layer messages, the application may fail or otherwise react unexpectedly if order is not strictly enforced by the transport-layer endpoint.